package com.cy.gameserver.dao.mapper;

import com.cy.gameserver.dao.common.TimestampTypeHandler;
import com.cy.gameserver.dao.entity.GPSSign;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * Created by tiankai.qin on 18/4/9.
 */
public interface GPSSignMapper {

    @Results({
            @Result(property = "user.uid", column = "uid"),
            @Result(property = "createTime", column = "create_time", typeHandler = TimestampTypeHandler.class)
    })
    @Select("select * from tb_gps_sign where x < #{xMax} and x > #{xMin} and y < #{yMax} and y > #{yMin}")
    List<GPSSign> selectGPSSignByXY(@Param("xMax") float xMax, @Param("xMin") float xMin,
                                    @Param("yMax") float yMax, @Param("yMin") float yMin);


    @Insert("insert into tb_gps_sign (uid,x,y,horizontal,vertical,compass,content) values(#{user.uid},#{x},#{y},#{horizontal}," +
            "#{vertical},#{compass},#{content})")
    void insertGPSSign(GPSSign gpsSign);
}
